import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export default defineStore('user', () => {
    let userInfo = ref({})
    let uid = ref("")
    let token = ref("")
    let isLogin = ref(false);
    let name = ref("")
    let nickname = ref("")

    function saveInf(value) {
        userInfo.value = value
    }
    function saveUid(value) {
        uid.value = value
    }
    function saveToken(value) {
        token.value = value
    }
    function saveIslogin(value) {
        isLogin.value = value
    }
    function saveNa(value) {
        name.value = value
    }
    function saveNick(value) {
        nickname.value = value
    }
    return { userInfo, uid, token, isLogin, name, nickname, saveInf, saveUid, saveToken, saveIslogin, saveNa, saveNick }
})

